﻿<%@ Page Title="Главная страница --- Smart Dating" Language="C#" MasterPageFile="~/Site.Master" AutoEventWireup="true" CodeBehind="Dashboard.aspx.cs" Inherits="WebUI.Dashboard" %>
<%@ Import Namespace="WebUI" %>
<%@ Import Namespace="WebUI.SmartDatingRef" %>
<%@ Register Assembly="TabStrip" Namespace="TabStrip" TagPrefix="tc" %>

<asp:Content ID="HeaderContent" ContentPlaceHolderID="HeadContent" runat="server">
    <link rel="stylesheet" type="text/css" href="Styles/Map.css"/>
    <script type="text/javascript" src="http://maps.google.com/maps/api/js?sensor=true&key=ABQIAAAAegU6asN6GoBRry4OXotuaxS6EqoafLsqtczoJvE4RdPZ3pik6xQ7ywLMXmfFlS8qHnxJF-LcTJA6uw">
    </script>
    <script type="text/javascript" src="Scripts/layout-map.js">
    </script>
    <script type="text/javascript" src="Scripts/expando.js">
    </script>
    <script type="text/javascript">
        $(document).ready(function () {
            loadMap();
            $(".searchbox").keypress(function (event) {
                if (event.keyCode == '13') {
                    window.location.href = 'Search.aspx?n=' + encodeURIComponent($(".searchbox")[0].value);
                    event.preventDefault();
                }
            });
        });
    </script>
</asp:Content>
<asp:Content ID="BodyContent" ContentPlaceHolderID="MainContent" runat="server">
    <input type="text" runat="server" id="txtFastSearch" class="searchbox" value="Поиск людей" onclick='if (this.value == "Поиск людей") this.value="";' onblur='if (this.value.length == 0) this.value = "Поиск людей";' />
    <div class="clear">
    </div>
    <h1>
        Кто я?</h1>         
    <div>
        <span class="errSpan" id="errMsg" runat="server" style="display: none;"></span>
        <span class="warningSpan" id="warningMsg" runat="server" style="display: none;"></span>
    </div>
    <div>
        <div class="myinfo tbl" id="pnlPersonalInfo" runat="server">
            <div class="row">
                <div class="cell padding_notop">
                    <asp:Image runat="server" ID="imgMe" ImageAlign="Middle" CssClass="big_photo" ImageUrl='<%#"Photo.aspx?large=true&id=" + pd.usr_id%>' AlternateText='<%#pd.first_name + " " + pd.last_name%>' /><br />
                    <a href='<%#"EditPhoto.aspx?id=" + pd.usr_id%>' id="cmdEditPhoto" class="linkbtn" runat="server">Загрузить фото</a>
                </div>
                <div class="cell padding_notop">
                    <asp:Image runat="server" ID="imgGender" ImageUrl='<%#"Images/gender_" + pd.gender.ToString() + ".png" %>' AlternateText="Пол" />
                    <asp:Label runat="server" ID="lblName" CssClass="user_name" Text='<%#pd.first_name + " " + pd.last_name %>'></asp:Label>
                    <asp:Label runat="server" ID="lblAge" CssClass="user_age"></asp:Label>
                    <br />

                    <img style="vertical-align: top" id="imgZodiac" runat="server" />
                    <span class="zodiac" id="lblZodiac" runat="server"></span>
                    <br />
                    <% if (pd != null) { %>
                        <tc:Expando runat="server" Caption="Контакты" IsExpanded="false" ExpandedCaptionCssClass="expando_caption expanded" CollapsedCaptionCssClass="expando_caption collapsed" ContentsCssClass="expando_contents" CssClass="expando_container">
                            <span runat="server" id="lblPhone" visible='<%#Utils.UsrHasPhone(pd) %>'>
                                <img src="Images/phone.png" alt="тел." />
                                <%#Utils.UsrPhone(pd) %>
                                <br />
                            </span>
                            <span runat="server" id="lblICQ" visible='<%#Utils.UsrHasICQ(pd) %>'>
                                <img src="Images/icq.png" alt="ICQ" />
                                <%#Utils.UsrICQ(pd)%>
                                <br />
                            </span>
                            <span runat="server" id="lblJabber" visible='<%#Utils.UsrHasJabber(pd) %>'>
                                <img src="Images/jabber.png" alt="Jabber" />
                                <%#Utils.UsrJabber(pd)%>
                            </span>
                        </tc:Expando>

                        <span class="property">Интересы:</span>
                        <br />
                        <div>
                            <asp:Repeater runat="server" ID="rptInterests">
                                <ItemTemplate><a href='<%#"Search.aspx?int=" + Container.DataItem %>' class="linkbtn hollow"><%#Container.DataItem %></a></ItemTemplate>
                            </asp:Repeater>
                        </div>
                        <span class="property">Цель знакомства:</span>
                        <br />
                        <%#Utils.ReasonToString(pd.reason) %> 
                    <% } %>
                </div>
            </div>
        </div>
        <a href="Personal.aspx" class="linkbtn" id="cmdEditData">Редактировать анкету</a>
        <br />
        <a href="Search.aspx" class="linkbtn findbtn" id="cmdFindPeople">Искать людей</a>
    </div>
    <h1>
        Обзор происходящего</h1>
    <tc:TabControl runat="server" ID="tabs" SelectedIndex="0" CssClass="tab_control">
        <tc:TabItem runat="server" Caption="Входящие">
            <div class="tbl" style="display: block;">
                <asp:ListView runat="server" ID="lstMessages" ItemPlaceholderID="pnlItem">
                    <EmptyDataTemplate>
                        <div class="short_description">Сообщений нет</div>
                    </EmptyDataTemplate>
                    <ItemTemplate>
                        <asp:Panel ID="pnlItem" runat="server" CssClass="usr" style="display: block;">
                            <div class="cell">
                                <img src='<%#"Photo.aspx?id=" + Utils.GetFromID(Container.DataItem) %>' alt='<%#Utils.GetFromName(Container.DataItem) %>' class="small_photo" />
                            </div>
                            <div class="cell">
                                <span class="uname"><%#Utils.GetFromName(Container.DataItem) %></span>
                                <span class="stime">&ndash; 
                                <%#Utils.GetDateSent(Container.DataItem) %></span>
                                <br />
                                <span class="subj">
                                <a href='<%#"Messages.aspx#msg" + Utils.GetMsgID(Container.DataItem) %>''>
                                <%#Utils.GetSubj(Container.DataItem) %></a></span>
                                <br />
                                <span class="msgbody"><%#Utils.GetShortBody(Container.DataItem) %></span>
                            </div>
                        </asp:Panel>
                    </ItemTemplate>
                    <AlternatingItemTemplate>
                        <asp:Panel ID="pnlItem" runat="server" CssClass="usr alternating" style="display: block;">
                            <div class="cell">
                                <img src='<%#"Photo.aspx?id=" + Utils.GetFromID(Container.DataItem) %>' alt='<%#Utils.GetFromName(Container.DataItem) %>' class="small_photo" />
                            </div>
                            <div class="cell">
                                <span class="uname"><%#Utils.GetFromName(Container.DataItem) %></span>
                                <span class="stime">&ndash; 
                                <%#Utils.GetDateSent(Container.DataItem) %></span>
                                <br />
                                <span class="subj">
                                <a href='<%#"Messages.aspx#msg" + Utils.GetMsgID(Container.DataItem) %>''>
                                <%#Utils.GetSubj(Container.DataItem) %></a></span>
                                <br />
                                <span class="msgbody"><%#Utils.GetShortBody(Container.DataItem) %></span>
                            </div>
                            <div class="clear">
                            </div>
                        </asp:Panel>
                    </AlternatingItemTemplate>
                </asp:ListView>
            </div>
            <a href="Messages.aspx" id="cmdMessages" class="linkbtn">Все сообщения</a>
        </tc:TabItem>
        <tc:TabItem runat="server" Caption="Где я сейчас">
            <div id="map" style="display: none;">
            </div>
            <span id="reverseGeocoded">&lt;название местоположения определить не удается&gt;</span>
            <a href="SetLocation.aspx" id="cmdMap" class="linkbtn">Мое местоположение&hellip;</a>
        </tc:TabItem>
    </tc:TabControl>
    
</asp:Content>
